﻿using StackExchange.Redis;

namespace RedisUtil
{
    /// <summary>
    /// Redis基类
    /// </summary>
    public class BaseRedis
    {
        /// <summary>
        /// 数据库操作
        /// </summary>
        public IDatabase DB;

        /// <summary>
        /// 发布订阅接口
        /// </summary>
        public ISubscriber Subscriber;

        public BaseRedis()
        {
            var connection = ConnectionMultiplexer.Connect("192.168.200.129:6379,defaultDatabase=0");
            DB = connection.GetDatabase();
            Subscriber = connection.GetSubscriber();
        }
    }
}
